'use strict';
angular.module('myApp.live', ['ngRoute'])
    .config(['$routeProvider', function($routeProvider) {
        $routeProvider.when('/weather', {
            templateUrl: 'view/live/live.html',
            controller: 'LiveCtrl'
        });
    }])
    .controller('LiveCtrl', function($scope,$http,$rootScope) {
        //$scope.spots=[{"name":"上海","info":"上乘富饶 生态之都"},{"name":"郴州","info":"人文毓秀 五岭之冲"},{"name":"九江","info":"江山殊秀 别开洞天"},{"name":"长沙","info":"楚汉名城 屈贾之乡"},{"name":"湘西","info":"山水秀奇 飘然仙境"}];
        var uri='/liveroom/bilibili';
        var host = 'http://120.76.205.241:8000';
        var apikey='CURuPgwUwNYK223PjWSMr9q16bPoaPOX8NTY6MnOLKaz6QLE0Ye0gqYNGcZE1OF0';
        var kw='lol';
        jQuery.ajax({
            type:'get',
            url:'static/json/live.json',
            data:{"apikey":apikey,'uri':uri,"host":host,"kw":kw},
            success:function(data){
                console.log(data);
            }
        });
        /*$http({
            method:'get',
            url:"php/live.php",
            params:{"apikey":apikey,'uri':uri,"host":host,"kw":kw}
        }).then(function successCallback(value) {
            console.log(value);
        })*/

    })/*.directive("ngHover",function(){
    return{
        restrict:'AE',
        link:function(scope,element,attrs){
            element.bind("mouseenter mouseleave",function(event){
                element.addClass('active');
            });
            element.bind("mouseleave",function(event){
                element.removeClass('active');
            });
        }
    }
})*/;
